<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<a4j:commandButton id="insertLabLine" onclick="#{rich:component('insertReserveLineLabPanel')}.show()" image="/images/addRow.png" actionListener="#{con100.insertReserveLineLabOpen}" disabled="#{!con100.editLab}"/>
<rich:scrollableDataTable var="labItem" value="#{con100.labItems}" width="950px" height="110px" id="reserveItemLabTable" selection="#{con100.selectionLab}" rowKeyVar="rkv">
	<rich:column sortable="false" width="40px">
		<f:facet name="header">
			<h:outputText value="#{bundle.reserve_lab_no}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.id.reserveLabNo}"></h:outputText>
	</rich:column>
	<rich:column sortable="false" width="80px">
		<f:facet name="header">
			<h:outputText value="#{bundle.color_tpc}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.colorTpc}"></h:outputText>
	</rich:column>
	<rich:column sortable="false" width="80px">
		<f:facet name="header">
			<h:outputText value="#{bundle.color_customer}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.colorCustomer}"></h:outputText>
	</rich:column>
	<rich:column sortable="false">
		<f:facet name="header">
			<h:outputText value="#{bundle.detail}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.detail}"></h:outputText>
	</rich:column>
	<rich:column sortable="false" width="80px">
		<f:facet name="header">
			<h:outputText value="#{bundle.no_lab}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.noLab}"></h:outputText>
	</rich:column>
	<rich:column sortable="false" styleClass="textCenter">
		<f:facet name="header">
			<h:outputText value="#{bundle.standard_date}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.standardDate}">
			<f:convertDateTime pattern="dd.MM.yyyy" locale="th_US"/>
		</h:outputText>
	</rich:column>
	<rich:column sortable="false" styleClass="textCenter">
		<f:facet name="header">
			<h:outputText value="#{bundle.confirm_lab_plan}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.confirmLabPlan}">
			<f:convertDateTime pattern="dd.MM.yyyy" locale="th_US"/>
		</h:outputText>
	</rich:column>
	<rich:column sortable="false" styleClass="textCenter">
		<f:facet name="header">
			<h:outputText value="#{bundle.confirm_lab_actual}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.confirmLabActual}">
			<f:convertDateTime pattern="dd.MM.yyyy" locale="th_US"/>
		</h:outputText>
	</rich:column>
	<rich:column sortable="false" styleClass="textCenter">
		<f:facet name="header">
			<h:outputText value="#{bundle.lab_date}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.reserveLabDate}">
			<f:convertDateTime pattern="dd.MM.yyyy" locale="th_US"/>
		</h:outputText>
	</rich:column>
	<rich:column sortable="false">
		<f:facet name="header">
			<h:outputText value="#{bundle.remark}"></h:outputText>
		</f:facet>
		<h:outputText value="#{labItem.remark}"></h:outputText>
	</rich:column>	
	<rich:column sortable="false" width="40px" styleClass="textCenter">
		<f:facet name="header">
			<h:outputText value="Actions"></h:outputText>
		</f:facet>
		
		<a4j:commandLink id="editLineLabLink" reRender="editReserveLineLabPanel,insertReserveLineLabAnswerPanel" oncomplete="#{rich:component('editReserveLineLabPanel')}.show()" ajaxSingle="true">
			<h:graphicImage value="/images/icon_edit_item.gif" style="border:0" />
		</a4j:commandLink>
		<a4j:commandLink id="editLineLabAnswerLink" reRender="editReserveLineLabPanel,insertReserveLineLabAnswerPanel" oncomplete="#{rich:component('insertReserveLineLabAnswerPanel')}.show()" ajaxSingle="true">
			<h:graphicImage value="/images/people-small.png" style="border:0" />
		</a4j:commandLink>
	</rich:column>	
	<a4j:support id="take_reservelineLab" event="onselectionchange" actionListener="#{con100.onchangeReserveLineLab}"/>
</rich:scrollableDataTable>